/* 限制 Mermaid 图表的最大高度并添加滚动条 */
.mermaid {
  max-height: 500px;
  overflow: auto;
  border: 1px solid #ddd;
  border-radius: 8px;
  padding: 16px;
  margin: 16px 0;
}

/* 限制 Markmap 脑图的最大高度并添加滚动条 */
.vp-markmap-container {
  max-height: 500px;
  overflow: auto;
  border: 1px solid #ddd;
  border-radius: 8px;
  padding: 16px;
  margin: 16px 0;
}

/* 暗色主题适配 */
html.dark .mermaid-container,
html.dark .vp-markmap-container {
  border-color: #444;
}

.name.clip {
  -webkit-text-fill-color: white;
  text-shadow: 0 2px 10px rgba(0, 0, 0, 0.3);
  opacity: 0.7;
}

.home .title {
  display: none;
}

.VPButton {
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
  opacity: 0.7;
}

/* === 首页背景图动画系统 === */

/* 1. 清空首页容器的直接背景，设置定位基点 */
.VPContent.is-home {
  position: relative;
  background: none !important;
  overflow: hidden;
}

/* 2. [图层1] 亮色模式背景图 (默认显示) */
.VPContent.is-home::before {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background-image: url("https://cdn4.winhlb.com/2025/11/09/69102d0b1cc9c.jpg");
  background-size: cover;
  background-position: center;
  background-repeat: no-repeat;
  z-index: -1;
  opacity: 1;
  transition: opacity 0.8s ease-in-out;
  transform: translateZ(0);
  will-change: opacity;
}

/* 3. [图层2] 暗色模式背景图 (默认隐藏) */
.VPContent.is-home::after {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background-image: url("https://cdn4.winhlb.com/2025/11/09/69102d0b93910.jpg");
  background-size: cover;
  background-position: center;
  background-repeat: no-repeat;
  z-index: -1;
  opacity: 0;
  transition: opacity 0.8s ease-in-out;
  transform: translateZ(0);
  will-change: opacity;
}

/* 4. 当切换到暗色主题时，交换两个图层的透明度 */
/* 👇 改为使用 .dark 类，而不是 @media */
.dark .VPContent.is-home::before {
  opacity: 0;
}
.dark .VPContent.is-home::after {
  opacity: 1;
}

/* === 遮罩层 === */
.VPContent.is-home > .VPHome::before {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background-color: rgba(0, 0, 0, 0.3);
  pointer-events: none;
  z-index: 1;
  transition: background-color 0.5s ease;
}

/* 也改为使用 .dark 类 */
.dark .VPContent.is-home > .VPHome::before {
  background-color: rgba(0, 0, 0, 0.6);
}

/* === 内容提层 === */
.VPContent.is-home > .VPHome > * {
  position: relative;
  z-index: 2;
}